<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var n = prompt('请输入三位数！'), ge = n % 10, 
        shi = parseInt(n / 10) % 10, 
        bai = parseInt(n / 100), sum = ge + shi + bai;
        alert(sum)
    </script>
</body>
</html>
